const getters = {
    token: state => state.user.token,
    userId: state => state.user.userId,
	userInfo: state => state.user.userInfo,
	cart: state => state.cart.cartGoods,
	// 购物车总价
	cartTotalPrice: state => {
		let money = 0;
		state.cart.cartGoods.forEach(goods => {
			money += goods.totalPrice
		})
		return money
	},
	cartNum: state => {
		return state.cart.cartGoods.length;
	},
}
export default getters